Yep, that checks out...
2+2 is indeed 5... for large values of 2. :wink:
Code:#include <stdio.h>
int main(void) {
double a = 2.4, b = 2.4;
printf("%.0f + %.0f = %.0f\n", a, b, a+b);
return 0;
}
Code:$ ./a
2 + 2 = 5
Uh, no. I mean you keep coming back with a bunch of silly or vague statements like "destructive mutation" and basically claiming that C programmers can't handle pointers in common idioms (e.g., copying one array to another), and also your buggy programs claiming to be somehow "better" or "more readable" (and now you mention a Java guy trying to do C :rolleyes:).
Like this silly statement.
Of course you'll see a "return" type of instruction in the assembly code that was produced by the compiler. That's what the C compiler is supposed to do (like I said, falling off the end of a function is the same as inserting a "return" statement there, which is incorrect for functions that return a value) (putting a "return" statement at the end of a function returning no value is like putting an unconditional "continue" statement at the end of a loop--harmless but pointless).
But this is a discussion of C (this being a C programming forum), not of some specific machine code that has no real reason to be mentioned.
When a wise man points at the moon the imbecile examines the finger.Quote:
Of course you'll see a "return" type of instruction in the assembly code
Confucius.
Yeah, this isn't going anywhere.